<%@ page language="java" contentType="text/html; charset=utf-8"
    pageEncoding="utf-8"%>
    <%@page import="java.util.List"%>
<%@page import="org.dzy.Dao.StudentDao"%>
<%@page import="org.dzy.Entity.Course"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>Insert title here</title>
</head>
<body><style type="text/css">
.zhuyemians {
	text-align: center;
	margin-left: auto;
	margin-right: auto;
	width: 700px;
	height: 100px;
}

.zuo {
	float: left;
}

.you {
	float: right;
}

.shang {
	width: 700px;
	height: 20px;
	border: #000 1px solid;
}

.xia {
	width: 700px;
	height: 300px;
	border: #000 1px solid;
}

.shang1 {
	float: left;
}

.xia1 {
	float: left;
}
</style>

<body>
	<div class="zhuyemians">
		<div class="shang">
			<div class="zuo">
				欢迎你,<%=request.getParameter("name")%>
			</div>
			<div class="you">
				<a href="addCourse.jsp">添加新课程</a> | <a href="login.jsp">[退出登陆]</a>
			</div>
		</div>
		<div class="xia">
			<div class="shang1">
				目前的选课情况如下:<br />
			</div>
			<div class="xia1">
				<table border="1px">
					<tr>
						<th>课程编号</th>
						<th>课程名称</th>
						<th>授课老师</th>
						<th>学分</th>
						<th>上课时间</th>
						<th>上课时间</th>
						<th>上课地点</th>
						<th>限制人数</th>
					</tr>
					<%
						StudentDao a = new StudentDao();
						List<Course> courses = a.queryAllCourses();
						for (Course course : courses) {
					%>
					<tr>
						<td><%=course.getCourse_id()%></td>
						<td><%=course.getCourse_name()%></td>
						<td><%=course.getTeacher()%></td>
						<td><%=course.getPoint()%></td>
						<td><%=course.getTime_1()%></td>
						<td><%=course.getTime_2()%></td>
						<td><%=course.getLocation()%></td>
						<td><%=course.getLimited()%></td>
					</tr>
					<%
						}
					%>

				</table>
			</div>
		</div>
	</div>

</body>
</html>